/* eslint-disable */

import {
    REQ_ORG_SUG,
    REC_ORG_SUG
  } from '../util/constants';

  import {handleActions} from 'redux-actions';
  import * as update from 'react-addons-update';
  import {createRequestReducer, createReceiveReducer, compose} from './helper';

  export default handleActions({
    [REQ_ORG_SUG]: createRequestReducer(),
    [REC_ORG_SUG]: compose((state, action) => action.error ? state : update(state, {
        data: {
            $set: action.payload.data.options
        }
    }), createReceiveReducer()),

  }, {
    ctx: null,
    data: null,
    message: null,
    fetching: false,
    invalid: false,
    error: null
  });
